import java.util.Scanner;

class DayOfYear{
	public static void main(String args[]){
		int[] dayOfMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入年份：");
		int year = scanner.nextInt();
		System.out.println("请输入月份：");
		int month = scanner.nextInt();
		System.out.println("请输入日期：");
		int day = scanner.nextInt();

		int days = 0;
		for(int i = 0; i < month - 1; i++){
			days += dayOfMonth[i];
		}
		if(year % 4 == 0 && year % 100 != 0 && month > 2){
			days += 1;
		}
		System.out.println("这是一年中的第" + days + "天");
	}
}